package com.easybuy.controller;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import javax.annotation.Resource;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.easybuy.pojo.News;
import com.easybuy.pojo.Product_category;
import com.easybuy.service.NewsService;
import com.easybuy.service.Product_categoryService;

@Controller
@RequestMapping("/home")
public class Product_categoryController {
	@Resource
	Product_categoryService p;	
	
	@RequestMapping("/menu")
	@ResponseBody
	public Map<String, List<Product_category>> select() {
		Map<String, List<Product_category>> map = new HashMap<String, List<Product_category>>();
		List<Product_category> list1 = p.selectCategories(1);
		List<Product_category> list2 = p.selectCategories(2);
		List<Product_category> list3 = p.selectCategories(3);
		map.put("list1", list1);
		map.put("list2", list2);
		map.put("list3", list3);
		return map;
	}
}
